\(\int \sec ^3(a+2 \log (c x^{-\frac {i}{2}})) \, dx\) [263]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 48 \[ \int \sec ^3\left (a+2 \log \left (c x^{-\frac {i}{2}}\right )\right ) \, dx=\frac {2 e^{3 i a} \left (c x^{-\frac {i}{2}}\right )^{6 i} x}{\left (1+e^{2 i a} \left (c x^{-\frac {i}{2}}\right )^{4 i}\right )^2} \]

[Out]

2*exp(3*I*a)*(c/(x^(1/2*I)))^(6*I)*x/(1+exp(2*I*a)*(c/(x^(1/2*I)))^(4*I))^2

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {4599, 4601, 270} \[ \int \sec ^3\left (a+2 \log \left (c x^{-\frac {i}{2}}\right )\right ) \, dx=\frac {2 e^{3 i a} x \left (c x^{-\frac {i}{2}}\right )^{6 i}}{\left (1+e^{2 i a} \left (c x^{-\frac {i}{2}}\right )^{4 i}\right )^2} \]

[In]

Int[Sec[a + 2*Log[c/x^(I/2)]]^3,x]

[Out]

(2*E^((3*I)*a)*(c/x^(I/2))^(6*I)*x)/(1 + E^((2*I)*a)*(c/x^(I/2))^(4*I))^2

Rule 270

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c*x)^(m + 1)*((a + b*x^n)^(p + 1)/(a*
c*(m + 1))), x] /; FreeQ[{a, b, c, m, n, p}, x] && EqQ[(m + 1)/n + p + 1, 0] && NeQ[m, -1]

Rule 4599

Int[Sec[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[x/(n*(c*x^n)^(1/n)), Subst[Int[x
^(1/n - 1)*Sec[d*(a + b*Log[x])]^p, x], x, c*x^n], x] /; FreeQ[{a, b, c, d, n, p}, x] && (NeQ[c, 1] || NeQ[n,
1])

Rule 4601

Int[((e_.)*(x_))^(m_.)*Sec[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[2^p*E^(I*a*d*p), Int[(e*x)^
m*(x^(I*b*d*p)/(1 + E^(2*I*a*d)*x^(2*I*b*d))^p), x], x] /; FreeQ[{a, b, d, e, m}, x] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \left (2 i \left (c x^{-\frac {i}{2}}\right )^{-2 i} x\right ) \text {Subst}\left (\int x^{-1+2 i} \sec ^3(a+2 \log (x)) \, dx,x,c x^{-\frac {i}{2}}\right ) \\ & = \left (16 i e^{3 i a} \left (c x^{-\frac {i}{2}}\right )^{-2 i} x\right ) \text {Subst}\left (\int \frac {x^{-1+8 i}}{\left (1+e^{2 i a} x^{4 i}\right )^3} \, dx,x,c x^{-\frac {i}{2}}\right ) \\ & = \frac {2 e^{3 i a} \left (c x^{-\frac {i}{2}}\right )^{6 i} x}{\left (1+e^{2 i a} \left (c x^{-\frac {i}{2}}\right )^{4 i}\right )^2} \\ \end{align*}

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(139\) vs. \(2(48)=96\).

Time = 0.11 (sec) , antiderivative size = 139, normalized size of antiderivative = 2.90 \[ \int \sec ^3\left (a+2 \log \left (c x^{-\frac {i}{2}}\right )\right ) \, dx=\frac {\sec ^2\left (a+2 \log \left (c x^{-\frac {i}{2}}\right )\right ) \left (\left (1+2 x^2\right ) \cos \left (a+2 \log \left (c x^{-\frac {i}{2}}\right )+i \log (x)\right )+i \left (-1+2 x^2\right ) \sin \left (a+2 \log \left (c x^{-\frac {i}{2}}\right )+i \log (x)\right )\right ) \left (-2 \cos \left (2 \left (a+2 \log \left (c x^{-\frac {i}{2}}\right )+i \log (x)\right )\right )+2 i \sin \left (2 \left (a+2 \log \left (c x^{-\frac {i}{2}}\right )+i \log (x)\right )\right )\right )}{4 x^2} \]

[In]

Integrate[Sec[a + 2*Log[c/x^(I/2)]]^3,x]

[Out]

(Sec[a + 2*Log[c/x^(I/2)]]^2*((1 + 2*x^2)*Cos[a + 2*Log[c/x^(I/2)] + I*Log[x]] + I*(-1 + 2*x^2)*Sin[a + 2*Log[
c/x^(I/2)] + I*Log[x]])*(-2*Cos[2*(a + 2*Log[c/x^(I/2)] + I*Log[x])] + (2*I)*Sin[2*(a + 2*Log[c/x^(I/2)] + I*L
og[x])]))/(4*x^2)

Maple [A] (verified)

Time = 272.79 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.02

method result size
parallelrisch \(\frac {x \left (i \sin \left (a +2 \ln \left (c \,x^{-\frac {i}{2}}\right )\right )+\cos \left (a +2 \ln \left (c \,x^{-\frac {i}{2}}\right )\right )\right )}{\cos \left (2 a +4 \ln \left (c \,x^{-\frac {i}{2}}\right )\right )+1}\) \(49\)
risch \(\frac {2 x \,c^{6 i} \left (x^{\frac {i}{2}}\right )^{-6 i} {\mathrm e}^{-3 \pi \,\operatorname {csgn}\left (i x^{-\frac {i}{2}}\right ) \operatorname {csgn}\left (i c \,x^{-\frac {i}{2}}\right )^{2}+3 \pi \,\operatorname {csgn}\left (i x^{-\frac {i}{2}}\right ) \operatorname {csgn}\left (i c \,x^{-\frac {i}{2}}\right ) \operatorname {csgn}\left (i c \right )+3 \pi \operatorname {csgn}\left (i c \,x^{-\frac {i}{2}}\right )^{3}-3 \pi \operatorname {csgn}\left (i c \,x^{-\frac {i}{2}}\right )^{2} \operatorname {csgn}\left (i c \right )+3 i a}}{\left (c^{4 i} \left (x^{\frac {i}{2}}\right )^{-4 i} {\mathrm e}^{-2 \pi \,\operatorname {csgn}\left (i x^{-\frac {i}{2}}\right ) \operatorname {csgn}\left (i c \,x^{-\frac {i}{2}}\right )^{2}} {\mathrm e}^{2 \pi \,\operatorname {csgn}\left (i x^{-\frac {i}{2}}\right ) \operatorname {csgn}\left (i c \,x^{-\frac {i}{2}}\right ) \operatorname {csgn}\left (i c \right )} {\mathrm e}^{2 \pi \operatorname {csgn}\left (i c \,x^{-\frac {i}{2}}\right )^{3}} {\mathrm e}^{-2 \pi \operatorname {csgn}\left (i c \,x^{-\frac {i}{2}}\right )^{2} \operatorname {csgn}\left (i c \right )} {\mathrm e}^{2 i a}+1\right )^{2}}\) \(238\)

[In]

int(sec(a+2*ln(c/(x^(1/2*I))))^3,x,method=_RETURNVERBOSE)

[Out]

x*(I*sin(a+2*ln(c*x^(-1/2*I)))+cos(a+2*ln(c*x^(-1/2*I))))/(cos(2*a+4*ln(c*x^(-1/2*I)))+1)

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 57 vs. \(2 (27) = 54\).

Time = 0.24 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.19 \[ \int \sec ^3\left (a+2 \log \left (c x^{-\frac {i}{2}}\right )\right ) \, dx=-\frac {2 \, {\left (2 \, x^{2} e^{\left (2 i \, a + 4 i \, \log \left (c\right )\right )} + 1\right )}}{x^{4} e^{\left (5 i \, a + 10 i \, \log \left (c\right )\right )} + 2 \, x^{2} e^{\left (3 i \, a + 6 i \, \log \left (c\right )\right )} + e^{\left (i \, a + 2 i \, \log \left (c\right )\right )}} \]

[In]

integrate(sec(a+2*log(c/(x^(1/2*I))))^3,x, algorithm="fricas")

[Out]

-2*(2*x^2*e^(2*I*a + 4*I*log(c)) + 1)/(x^4*e^(5*I*a + 10*I*log(c)) + 2*x^2*e^(3*I*a + 6*I*log(c)) + e^(I*a + 2
*I*log(c)))

Sympy [F]

\[ \int \sec ^3\left (a+2 \log \left (c x^{-\frac {i}{2}}\right )\right ) \, dx=\int \sec ^{3}{\left (a + 2 \log {\left (c x^{- \frac {i}{2}} \right )} \right )}\, dx \]

[In]

integrate(sec(a+2*ln(c/(x**(1/2*I))))**3,x)

[Out]

Integral(sec(a + 2*log(c/x**(I/2)))**3, x)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 162 vs. \(2 (27) = 54\).

Time = 0.24 (sec) , antiderivative size = 162, normalized size of antiderivative = 3.38 \[ \int \sec ^3\left (a+2 \log \left (c x^{-\frac {i}{2}}\right )\right ) \, dx=\frac {2 \, {\left ({\left (\cos \left (3 \, a\right ) + i \, \sin \left (3 \, a\right )\right )} \cos \left (6 \, \log \left (c\right )\right ) + {\left (i \, \cos \left (3 \, a\right ) - \sin \left (3 \, a\right )\right )} \sin \left (6 \, \log \left (c\right )\right )\right )} x e^{\left (6 \, \arctan \left (\sin \left (\frac {1}{2} \, \log \left (x\right )\right ), \cos \left (\frac {1}{2} \, \log \left (x\right )\right )\right )\right )}}{{\left ({\left (\cos \left (4 \, a\right ) + i \, \sin \left (4 \, a\right )\right )} \cos \left (8 \, \log \left (c\right )\right ) - {\left (-i \, \cos \left (4 \, a\right ) + \sin \left (4 \, a\right )\right )} \sin \left (8 \, \log \left (c\right )\right )\right )} e^{\left (8 \, \arctan \left (\sin \left (\frac {1}{2} \, \log \left (x\right )\right ), \cos \left (\frac {1}{2} \, \log \left (x\right )\right )\right )\right )} + 2 \, {\left ({\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} \cos \left (4 \, \log \left (c\right )\right ) + {\left (i \, \cos \left (2 \, a\right ) - \sin \left (2 \, a\right )\right )} \sin \left (4 \, \log \left (c\right )\right )\right )} e^{\left (4 \, \arctan \left (\sin \left (\frac {1}{2} \, \log \left (x\right )\right ), \cos \left (\frac {1}{2} \, \log \left (x\right )\right )\right )\right )} + 1} \]

[In]

integrate(sec(a+2*log(c/(x^(1/2*I))))^3,x, algorithm="maxima")

[Out]

2*((cos(3*a) + I*sin(3*a))*cos(6*log(c)) + (I*cos(3*a) - sin(3*a))*sin(6*log(c)))*x*e^(6*arctan2(sin(1/2*log(x
)), cos(1/2*log(x))))/(((cos(4*a) + I*sin(4*a))*cos(8*log(c)) - (-I*cos(4*a) + sin(4*a))*sin(8*log(c)))*e^(8*a
rctan2(sin(1/2*log(x)), cos(1/2*log(x)))) + 2*((cos(2*a) + I*sin(2*a))*cos(4*log(c)) + (I*cos(2*a) - sin(2*a))
*sin(4*log(c)))*e^(4*arctan2(sin(1/2*log(x)), cos(1/2*log(x)))) + 1)

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (27) = 54\).

Time = 1.19 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.73 \[ \int \sec ^3\left (a+2 \log \left (c x^{-\frac {i}{2}}\right )\right ) \, dx=-\frac {4 \, c^{4 i} x^{2} e^{\left (2 i \, a\right )}}{c^{10 i} x^{4} e^{\left (5 i \, a\right )} + 2 \, c^{6 i} x^{2} e^{\left (3 i \, a\right )} + c^{2 i} e^{\left (i \, a\right )}} - \frac {2}{c^{10 i} x^{4} e^{\left (5 i \, a\right )} + 2 \, c^{6 i} x^{2} e^{\left (3 i \, a\right )} + c^{2 i} e^{\left (i \, a\right )}} \]

[In]

integrate(sec(a+2*log(c/(x^(1/2*I))))^3,x, algorithm="giac")

[Out]

-4*c^(4*I)*x^2*e^(2*I*a)/(c^(10*I)*x^4*e^(5*I*a) + 2*c^(6*I)*x^2*e^(3*I*a) + c^(2*I)*e^(I*a)) - 2/(c^(10*I)*x^
4*e^(5*I*a) + 2*c^(6*I)*x^2*e^(3*I*a) + c^(2*I)*e^(I*a))

Mupad [B] (verification not implemented)

Time = 31.77 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.81 \[ \int \sec ^3\left (a+2 \log \left (c x^{-\frac {i}{2}}\right )\right ) \, dx=\frac {2\,x\,{\mathrm {e}}^{a\,3{}\mathrm {i}}\,{\left (\frac {c}{x^{\frac {1}{2}{}\mathrm {i}}}\right )}^{6{}\mathrm {i}}}{{\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (\frac {c}{x^{\frac {1}{2}{}\mathrm {i}}}\right )}^{4{}\mathrm {i}}+1\right )}^2} \]

[In]

int(1/cos(a + 2*log(c/x^(1i/2)))^3,x)

[Out]

(2*x*exp(a*3i)*(c/x^(1i/2))^6i)/(exp(a*2i)*(c/x^(1i/2))^4i + 1)^2